<?php
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
class table_aljbd_page extends discuz_table{
	public function __construct() {

			$this->_table = 'aljbd_page';
			$this->_pk    = 'id';

			parent::__construct();
	}
	public function fetch_all_by_uid_bid($uid=0,$bid=0){
		$conn=' where 1';
		$where[]=$this->_table;
		if($uid){
			$where[]=$uid;
			$conn.=' and uid=%d';
		}
		if($bid){
			$where[]=$bid;
			$conn.=' and bid=%d';
		}
		
		if($order){
			if($order=='view'){
				$conn.=' order by '.addslashes($order).' desc';
			}else{
				$conn.=addslashes($order);
			}
		}else{
			$conn.=' order by id desc';
		}
		
		if(isset($start)&&isset($perpage)){
			$where[]=$start;
			$where[]=$perpage;
			$conn.=' limit %d,%d';
		}
		return DB::fetch_all('select * from %t '.$conn,$where);
	}
}




?>